package com.zycoin.nio;

import java.util.UUID;

/**
 * @author zhongyicheng
 * create date 2018/1/12.
 */
public class Process implements Runnable {

    private Handler handler;
    private String reqMsg;

    public Process(String reqMsg, Handler handler) {
        this.reqMsg = reqMsg;
        this.handler = handler;
    }

    public void run() {
        handler.process(this.process());
    }

    private String process() {
        System.out.println("receive:"+reqMsg);
        String sendData = UUID.randomUUID().toString() + ":" + reqMsg;
        System.out.println("send:"+sendData);
        return sendData;
    }
}
